<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.virtualmall.common.Constants"%>
<!DOCTYPE html>
<html>
 <head>
  <title> 首页 </title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="generator" content="editplus" />
  <meta name="author" content="guanqing" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <jsp:include page="commons/header.jsp"></jsp:include>
  <script type="text/javascript" src="js/customer.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
        customer.recommendProducts(0);
    });
  </script>
 </head>
 <body>
    <jsp:include page="commons/menu.jsp"></jsp:include>
	<div class="indexAd"><img src="<%=request.getContextPath() %>/style/images/ad1.png"/></div>
	<div class="index">
		<div class="titleBox productList">
			<div class="titleBar">
				<h3>新品推荐</h3>
				<a href="<%=request.getContextPath() %>/recommendProducts">更多</a>
			</div>
			<ul id="productList" class="mode_list">
			</ul>
		</div>
		<div class="titleBox indexLogin">
		    <%
		        if(session.getAttribute(Constants.USER_ID_SESSION) != null){
		    %>
		            <div class="titleBar">
		                <h3>个人信息</h3>
		            </div>
		            <div class="userInfo">
		                <div class="userPhoto"><img src="style/images/img1.png" alt="" /></div>
		                <div style="padding-left:130px;">
		                    <p>账号：<span id="userName"></span></p>
		                    <p>账户性质：<span id="accountType"></span></p>
		                    <p>订单提醒： <a href="<%=request.getContextPath() %>/home?func=shoppingCart">待付款(<span id="shoppingCartCountInIndexPage">0</span>)</a></p>
		                    <p>上次登录时间：<span id="lastLoginDate"></span> <br/><a id="manageUrl" href="javascript:void(0);">后台管理</a></p>
		                </div>
		            </div>
					<script type="text/javascript">
				        customer.getCurrentUserInfo(0);
					</script>
		    <%       
		        }else{
		    %> 
				    <div class="login">
		                <form id="signForm" method="post">
		                    <ul class="mode_add">
		                        <li>
		                            <label>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</label>
		                            <input type="text" name="accountName" id="accountName" class="input_txt" />
		                        </li>
		                        <li>
		                            <label>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</label>
		                            <input type="password" name="pwd" id="pwd" class="input_txt" /><span class=""></span>
		                            <p id="loginError" style="display:none;"><span id="loginErrorTips" class="error"></span></p>
		                        </li>
		                    </ul>
		                    <div class="wrapLoginBtn">
		                       <input type="submit" name="" value="" class="loginBtn" /><br />
		                       <a href="<%=request.getContextPath() %>/register">用户注册</a>
		                    </div>
		                </form>
		            </div>
					<script type="text/javascript">
					$(document).ready(function() {
					    account.initLoginForm();
					});
					</script>
		    <%   
		        }
		    %>
			
			<img  src="<%=request.getContextPath() %>/style/images/downloadImg.png" border="0" usemap="#Map" class="downloadImg" />
            <map name="Map">
              <area shape="rect" coords="170,32,355,85" href="javascript:void(0);">
            </map>
        </div>
	</div>
    <jsp:include page="commons/footer.jsp"></jsp:include>
 </body>
</html>
